/**
 * Created by shenchen1@jd.com on 2016/10/27
 */
'use strict';

import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import Navigation from './JDReactAPIDemos/Navigation'
// import {
//   JDNetwork,
// } from '@areslabs/jdreact-core-lib';
// import fetchJsonp from '@areslabs/jdreact-core-web/Libraries/Fetch/Jsonp';
// just disable warnning
// console.disableYellowBox = true;
var host = '//api.m.jd.com';
if ((/^beta-/gi).test(location.host) || (/\.care$/gi).test(location.host) || location.port === '3000') {
    host = '//beta-api.m.jd.com'
}
// JDNetwork.setFetchProxy(function(functionId, params) {
//     return fetchJsonp(`${host}/client.action?functionId=${functionId}&body=${encodeURIComponent(params)}&client=ld&clientVersion=1.0.0`, {
//         jsonpCallback: 'jsonp'
//     });
// });
class JDReactAPIDemos extends Component {
  render() {
    return (
      <Navigation />
    );
  }
}

AppRegistry.registerComponent('JDReactAPIDemos', () => JDReactAPIDemos);

var app = document.getElementById('m_common_content');
if (!app) {
  app = document.createElement('div');
  document.body.appendChild(app);
}
AppRegistry.runApplication('JDReactAPIDemos', {
  rootTag: app
});